<?php if (!defined('THINK_PATH')) exit();?><link href="/rywechat/Public/plugins/fitui/tablegrid.css" rel="stylesheet">
<script src="/rywechat/Public/js/backend/format.js"></script>
<script src="/rywechat/Public/plugins/fitui/tablegrid.js"></script>
<script src="/rywechat/Public/js/backend/merchant.js"></script>
<script src="/rywechat/Public/js/backend/area.js"></script>
<style type="text/css">
.table td {
  vertical-align: top !important;
}
</style>
<script>
var Param = <?php echo json_encode($param) ?> ;
$(function(){
  Merchant.init( <?php echo json_encode($config) ?> );
  Area.init( <?php echo json_encode($area) ?> );
});

</script>

<div class="page-content">
  <ol class="breadcrumb">
    <li><a href="<?php echo $home_url ?>">首页</a></li>
    <li class="active"><?php echo $module_name ?></li>
  </ol>
  <div class="page-content-inner"> 
    <!-- read_modal -->
    <div class="portlet blue" id="read_modal"> 
      <!-- portlet-title -->
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-pied-piper-alt  "></i> <?php echo $module_name ?> </div>
        <div class="tools"> 
          <a href="<?php echo $module_url ?>?action=create" class="toolbtn add load_add_modal_btn" data-toggle="tooltip" data-placement="top" title="新增"></a> 
          <a class="toolbtn reload" data-toggle="tooltip" data-placement="top" title="刷新"></a> 
        </div>
      </div>
      <!-- end portlet-title -->
      <div class="portlet-body ">
        <form class="form-inline" id="search_form" method="post" >
          <div class="form-group" style="margin-bottom:16px;">
            <label for="keyword">关键字：</label>
            <input type="text" class="form-control" id="keyword" placeholder="名称 联系人 电话" >
          </div>
          <div class="form-group" style="margin-bottom:16px;">
            <label for="type">类型：</label>
            <select id="type" class="form-control">
              <option value="0" selected >不限类型</option>
              <?php echo form_options( $param['type'] ) ?>
            </select>
          </div>
          <div class="form-group" style="margin-bottom:16px;">
            <label for="status">状态：</label>
            <select id="status" class="form-control">
              <option value="0" selected >不限状态</option>
              <?php echo form_options( $param['status'] ) ?>
            </select>
          </div>
          <div class="form-group" style="margin-bottom:16px;">
            <button type="submit" class="btn btn-primary" id="search_btn"><i class="fa fa-search"> </i> 查询</button>
          </div>
        </form>
        <!-- table grid -->
        <div class="table-responsive">
          <table id="data_table" class="table table-striped table-hover table-condensed">
            <thead>
              <tr>
                <th width="80" data-field="id"  >ID</th>
                <th width="80" data-field="sort"  >排序</th>
                <th width="80" data-field="type" data-formatter="format_type" >类型</th>
                <th width="160" data-field="name" data-formatter="format_name"  >公司名</th>
                <th width="160" data-field="telphone" data-formatter="format_contact" >联系人/座机/手机</th>
                <th width="160" data-field="email"  >邮箱</th>
                <th width="80" data-field="status" data-formatter="format_status" >状态</th>
                <th width="80" data-field="area"  >区域</th>
                <th width="300" data-formatter="format_opt">操作</th>
                <th>&nbsp;</th>
              </tr>
            </thead>
          </table>
        </div>
        <!-- end table --> 
      </div>
    </div>
    <!-- end portlet read_modal --> 
    
    <!-- add_edit_modal  -->
    <div class="portlet" id="add_edit_modal" style="display:none;">
      <div class="portlet-title">
        <div class="caption"> <i class="fa fa-cogs"></i> <span id="action_label"></span> <?php echo $module_name ?> </div>
      </div>
      <div class="portlet-body ">
        <form id="submit_form" class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-3 control-label">公司名</label>
            <div class="col-sm-7">
              <input name="name" placeholder="公司名" data-valid="required" data-tips="请填写正确的公司名" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">公司座机</label>
            <div class="col-sm-7">
              <input name="telphone" placeholder="公司座机" data-valid="required" data-tips="请填写正确的公司座机(区号-电话号码)" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">联系人</label>
            <div class="col-sm-7">
              <input name="contact" placeholder="联系人" data-valid="required" data-tips="请填写正确的联系人" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">联系人手机号</label>
            <div class="col-sm-7">
              <input name="phone" placeholder="手机号" data-valid="required" data-tips="请填写正确的联系人手机号" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">email</label>
            <div class="col-sm-7">
              <input name="email" placeholder="email" data-valid="required" data-tips="请填写正确的email" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">区域</label>
            <div class="col-sm-7">
              <div class="col-sm-4">
                <select id="province" class="form-control"></select>
              </div>
              <div class="col-sm-4">
                <select id="city" class="form-control"></select>
              </div>
              <div class="col-sm-4">
                <select id="district" name="area" class="form-control"></select>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">详细地址</label>
            <div class="col-sm-7">
              <input name="address" placeholder="详细地址" data-valid="required" data-tips="请填写正确的详细地址" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">状态</label>
            <div class="col-sm-7">
              <select name="status" class="form-control">
                <?php echo form_options( $param['status'] ) ?>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">类型</label>
            <div class="col-sm-7">
              <select name="type" class="form-control">
                <?php echo form_options( $param['type'] ) ?>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">企业资质</label>
            <div class="col-sm-7">
              <input name="qualified" placeholder="企业资质" data-valid="required" data-tips="请填写正确的企业资质" type="text" class="form-control" >
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3 control-label">资质编号</label>
            <div class="col-sm-7">
              <input name="qualified_code" placeholder="资质编号" data-valid="required" data-tips="请填写正确的资质编号" type="text" class="form-control" >
            </div>
          </div>

          <hr>
          <div class="row">
            <div class="col-md-12" style="text-align:center">
              <button class="btn btn-default btn-lg " id="add_edit_close_btn" type="button"><i class="fa fa-arrow-left"></i> 返回</button>
              <button class="btn btn-danger btn-lg " id="submit_btn" type="button"><i class="fa fa-edit"></i> 提交</button>
            </div>
          </div>
        </form>
      </div>
    </div>
    <!-- end portlet add_edit_modal --> 
  </div>
  <!-- end page-content-inner --> 
</div>